home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000098_icon-group-sender_Tue Oct 24 13:26:56 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKQmx24336
  4.     for icon-group-addresses; Tue, 24 Oct 2000 13:26:48 -0700 (MST)
  5. Message-Id: <200010242026.e9OKQmx24336@baskerville.CS.Arizona.EDU>
  6. From: symbiot@my-deja.com
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: How to "declare" a string?
  9. Date: Tue, 24 Oct 2000 18:03:48 GMT
  10. To: trollet@skynet.be
  11. X-Article-Creation-Date: Tue Oct 24 18:03:48 2000 GMT
  12. X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
  13. X-Http-Proxy: 1.0 SRVPROXY, 1.0 x61.deja.com:80 (Squid/1.1.22) for client 208.51.185.226
  14. X-MyDeja-Info: XMYDJUIDsymbiot
  15. To: icon-group@cs.arizona.edu
  16. Errors-To: icon-group-errors@cs.arizona.edu
  17. Status: RO
  18. Content-Length: 1711
  19.  
  20. Hi,
  21.  
  22. Thanks for your response.
  23.  
  24. I based my program on the same assumption you made concerning how ICON
  25. scan variables and assigns type according to usage (and even converts
  26. on the fly).
  27.  
  28. But in the statement I listed, it seemed to barf because I was
  29. requiring it to create an indexed string.
  30.  
  31. The line was, essentially,
  32.  
  33. data[index] := .....results of some string operation....
  34.  
  35. I even tried intially data with
  36.  
  37. data := " "
  38.  
  39. But that created a variable that was one cell in size. So when the
  40. abouve statement got to "index := 2", it barfed because the variable
  41. data wasn't large enough.
  42.  
  43. So again I'm back to the quesiton, "How to 'declare' a string variable?"
  44.  
  45. In article <39F43189.BBF358BC@skynet.be>,
  46.   Atle <trollet@skynet.be> wrote:
  47. > symbiot@my-deja.com wrote:
  48. > >
  49. >
  50. > > best I can tell, it is choking because UPPER has not
  51. been "declared".
  52. > I am a *total* newbie, but I may have an answer to this one
  53. > (Icon programmer please correct this if wrong)
  54. > Icon will extract as much information from your statements as
  55. possible.
  56. >
  57. > so, if you initialize a variable like this:
  58. >
  59. > i := 0
  60. >
  61. > it will not need an
  62. >
  63. > i : INTEGER to figure it out, it knows that 0 is an integer, and will
  64. declare i implicitely.
  65. >
  66. > the same with a string:
  67. >
  68. > s := ""
  69. >
  70. > will implicitely declare s to be string type.
  71. >
  72. > If in the start of your program, you set
  73. >
  74. > UPPER := ""
  75. >
  76. > you might solve an 'undeclared' reference ...
  77. >
  78. > PS!
  79. > Please have this checked. It is just a suggestion.
  80. > ENDPS!
  81. >
  82. > --
  83. > Best wishes, Atle
  84. >
  85. > users.skynet.be/atle
  86. >
  87.  
  88. --
  89. "Wife who put husband in doghouse, soon find him in cathouse."
  90.                             -- Wisdom of the Tao
  91.  
  92.  
  93. Sent via Deja.com http://www.deja.com/
  94. Before you buy.
  95.